<template>
  <div class="box">
    <header class="header">
      <van-nav-bar
        title="我的信息"
        left-arrow
        @click-left="$router.back()"
      />
    </header>
    <div class="content">
      <div style="display:flex;justify-content:space-between;">
         用户名:{{username}}
         <van-button type="default" size="samll" @click="loginout">退出登录</van-button>
      </div>
    </div>
  </div>
</template>

<script setup>
const username = localStorage.getItem('username')
import {useRouter} from 'vue-router'
const router = useRouter()
const loginout=()=>{
   localStorage.removeItem('token')
   localStorage.removeItem('username')
   router.push('/login')
}
</script>